package tk.mybatis.mapper.common.example.oper;

import java.util.Map;

public class Oper {
	protected String column;
	protected Object condition;
	protected String jdbcType;
	
	public String build() {
		return column + condition;
	}
	
	protected void commonParser(String property, Number number, Map<String, String> propertyMap, String oper) {
		definition(property, propertyMap, oper + number);;
	}
	
	protected void definition(String property,Map<String, String> propertyMap, String oper) {
		if(! propertyMap.containsKey(property)) {
			throw new RuntimeException("当前实体类不包含名为" + property + "的属性!");
		}
		
		this.column = propertyMap.get(property);
		this.condition = this.column + oper;
	}

	public String getColumn() {
		return column;
	}

	public Object getCondition() {
		return condition;
	}
	
	public String getJdbcType() {
		return jdbcType;
	}
}
